let filePath = '';   // 默认文件路径
let TimeStamp = '';  // 时间戳
let Version = '-V1'; // 版本号
//编译环境判断，可以根据不同环境来做相应的配置
if (process.env.UNI_PLATFORM === 'h5') {
  filePath = 'static/js/'
  TimeStamp =Math.floor(Math.random () * 900) + 100;
}

module.exports = {
  configureWebpack: {
    output: { // filePath: 路径 name: 默认文件名 Version: 版本号 TimeStamp: 时间戳; 重构文件名
      filename: `${filePath}[name]${Version}${TimeStamp}.js`, // static/js/index-V2.0.0-1623123456789.js
      chunkFilename: `${filePath}[name]${Version}${TimeStamp}.js` // static/js/pages-home-index-V2.0.0-1623123456789.js
    },
  },
  devServer: {
    proxy: {
      '/dev-api': {
        target: 'https://bdzh5.westts.cn',
        pathRewrite: {
          '/dev-api': '/dev-api'
        }
      }
    },
  }
}

